import { Inject } from '@midwayjs/core';
import { CoolController, BaseController } from '@cool-midway/core';
import { CouponInfoEntity } from '../../entity/info';
import { CouponInfoService } from '../../service/info';

/**
 * 优惠券信息
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: CouponInfoEntity,
  service: CouponInfoService,
  pageQueryOp: {
    keyWordLikeFields: ['a.name'],
    fieldEq: ['a.type', 'a.status'],
    where: async ctx => {
      const {} = ctx.request.body;
      const where = [];
      return where;
    },
  },
})
export class AdminCouponInfoController extends BaseController {
  @Inject()
  couponInfoService: CouponInfoService;
}
